$(function(){
    var list=$('#list');
    loginTest();
    changeName();
    createHtml();

    /*修改用户名*/
    function changeName(){
        var myName=LsyCookie.getItem('loginUser');
        var name=$('#name');
        var nick=$('#nick');
        if(myName){
            name.text(myName);
            nick.text(myName);
        }
    }
    /*创建HTML*/
    function createHtml(){
        var orderDatas=LsyStorage.getArr('orderList');
        var str='';
        for(var i=0;i<orderDatas.length;i++){
            str+=
                '<tr>'
                +'<td><a href="pro_details.html?id='+orderDatas[i].id+'"><img src="'+orderDatas[i].imgSrc+'" alt="order_1.png"></a></td>'
                +'<td><h3><a href="pro_details.html?id='+orderDatas[i].id+'">'+orderDatas[i].title+'</a></h3></td>'
                +'<td>¥<span>'+orderDatas[i].price+'</span></td>'
                +'<td>'+orderDatas[i].time+'</td>'
                +'<td>交易成功</td>'
                +'<td><a href="order_details.html?id='+orderDatas[i].id+'">订单详情</a></td>'
                +'</tr>'
        }
        list.html(str);
    }
});
